﻿/////** Created By Yuggo Hor on April 2016 */



//myApp.controller("autoCompleteController", ['$scope', function ($scope) {

   

//    var text = {
//        "State": [
//          "Penang", "Kedah", "Perak"
//        ]
//    }
//    console.log(" this is the text for state", text.State);
//    $scope.location = text.State;
//}])

//myApp.directive('autoCompleteDirective', function ($http) {
//    return {
//        restrict: 'A',
//        scope: {
//            url: '@',
//            ngModel : '='
//        },
//        require: 'ngModel',
//        link: function (scope, elem, attrs) {
//            console.log("this is the elem",elem);
//            elem.autocomplete({
//                source: function (request, response) {
//                    $http({ method: 'jsonp', url: scope.url, params: { q: request.term } })
//                    .success(function (data) {
//                        response(data);
//                    });
//                },
//                minLength: 3,
//                select: function (event, ui) {
//                    scope.$apply(function () {
//                        scope.ngModel = ui.item.value;
//                    });
//                }
//            })
//        }
//    }



//})
